package net.seayan.designpattern4j.singleton;

/**
 * 单例模式 存在线程安全问题
 * 
 * @ClassName: Singleton
 * @author: yanmeng
 * @date:2012-8-29 下午5:18:48
 */
public class SingletonSimple {

	private static SingletonSimple single = null;
	private static String singletonInfo;

	private SingletonSimple() {
		// 可以进行一些信息的初始化操作
		singletonInfo = System.currentTimeMillis() + "";
	}

	// 单例类获取方法，存在线程安全问题
	public static SingletonSimple getInstance() {
		if (single == null)
			single = new SingletonSimple();

		return single;
	}

	public String getSingletonInfo() {
		return singletonInfo;
	}
}
